Skip to content

连接远程服务端 - ConnectRemoteEx

函数简介

A 端 连接 B 端远程服务,并在连接、CreateInstance 之后自动在 B 端执行 Reg(注册到后台)。

接口名称

ConnectRemoteEx

DLL调用

c
int32_t ConnectRemoteEx(int64_t instance, char* host, int32_t port,
                        char* token, char* userCode, char* softCode,
                        char* featureList, int32_t timeoutMs);

参数说明

参数名类型说明
instance长整数型OLAPlug 对象指针,由 CreateCOLAPlugInterFace 接口生成。
host字符串B 端服务 IP 或域名。
port整数型B 端监听端口。
token字符串与 B 端一致)。
userCode字符串用户码(用于 Reg)。
softCode字符串软件码(用于 Reg)。
featureList字符串功能列表(用于 Reg)。
timeoutMs整数型单次调用超时(毫秒);0 使用默认值。

示例

SDK 调用

cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int ret = ola.ConnectRemoteEx("127.0.0.1", 9000, "token");
csharp
using OLAPlug;

var ola = new OLAPlugServer();
int ret = ola.ConnectRemoteEx("127.0.0.1", 9000, "token");
python
from OLAPlugServer import OLAPlugServer

ola = OLAPlugServer()
ret = ola.ConnectRemoteEx("127.0.0.1", 9000, "token")
java
import com.olaplug.OLAPlugServer;

OLAPlugServer ola = new OLAPlugServer();
int ret = ola.ConnectRemoteEx("127.0.0.1", 9000, "token");
cpp
var ola = com("OlaPlug.OlaSoft")
var ret = ola.ConnectRemoteEx("127.0.0.1", 9000, "token")
vbscript
Set ola = CreateObject("OlaPlug.OlaSoft")
ret = ola.ConnectRemoteEx("127.0.0.1", 9000, "token")
text
.局部变量 ola, OLAPlug
ola.创建 ()
ret = ola.ConnectRemoteEx(“127.0.0.1“, 9000, “token“)
aardio
import OLAPlugServer;
var ola = OLAPlugServer();
var ret = ola.ConnectRemoteEx("127.0.0.1", 9000, "token");
text
变量 ola <类型 = OLAPlugServer>
ola = 新建 OLAPlugServer
整数 ret = ola.ConnectRemoteEx("127.0.0.1", 9000, "token")
cpp
#include "OLAPlugServer.h"

OLAPlugServer ola;
int ret = ola.ConnectRemoteEx("127.0.0.1", 9000, "token");

原生 DLL 调用

cpp
long instance = CreateCOLAPlugInterFace();
ConnectRemoteEx(instance, "127.0.0.1", 9000, "token");
csharp
long instance = CreateCOLAPlugInterFace();
ConnectRemoteEx(instance, "127.0.0.1", 9000, "token");
python
from ctypes import CDLL, c_int, c_int64, create_string_buffer

ola = CDLL("OLAPlug_x64.dll")
ola.CreateCOLAPlugInterFace.restype = c_int64
instance = ola.CreateCOLAPlugInterFace()
ConnectRemoteEx(instance, "127.0.0.1", 9000, "token")

返回值

1 成功,0 失败。

注意事项